from Utils import decode_chunked, print_packet

class Hooker:
    def hook_request(self, request):
        return request

    def hook_response(self, response):
        return response

    def grab_transaction(self, request, response):
        try:
            request_packet = remoting.decode(request)
        print_packet(request_packet)
        except Exception as e:
            print e

        try:
            response = decode_chunked(response)
            response_packet = remoting.decode(response)
        print_packet(response_packet)
        except Exception as e:
            print e

